package com.online.servlet.admin;

import com.online.pojo.UpComing_Shop;
import com.online.service.user.Impl.ShopServiceImpl;
import com.online.service.user.ShopService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@WebServlet("/reload")
public class reloadServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<UpComing_Shop> list =new ArrayList<UpComing_Shop>();
        try {
            ShopService shopService = new ShopServiceImpl();
            shopService.select(list);
            req.setAttribute("list",list);
            req.getRequestDispatcher("/jsp/administrator.jsp").forward(req,resp);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }


    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req,resp);
}
}